package com.stu.bean;

import lombok.Data;
import lombok.ToString;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * @author MI
 * @ClassName User.java
 * @createTime 2021年12月23日 22:17:00
 */
@Data
@ToString
public class User {
    private int id;
    private String name;

    static {
        System.out.println("静态代码块");
    }

    {
        System.out.println("普通代码块");
    }

    public User() {
        System.out.println("User.User--无参构造");
    }

    public User(int id) {
        this.id = id;
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this, ToStringStyle.NO_CLASS_NAME_STYLE);
    }
}
